<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>收费设置</title>
    <link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css" />
    <link rel="stylesheet" href="/static/assets/module/admin.css?v=312" />
    <style>
        .layui-form-item {
            margin-bottom: 25px;
        }

        label .layui-icon {
            font-size: 14px;
            color: #666;
        }
    </style>
</head>

<body>

    <!-- 加载动画 -->
    <div class="page-loading">
        <div class="ball-loader">
            <span></span><span></span><span></span><span></span>
        </div>
    </div>

    <!-- 正文开始 -->
    <div class="layui-fluid">
            <div class="layui-card">
                <div class="layui-card-body">
                    <blockquote class="layui-elem-quote">修改指南: 免费用户一天可以免费查看多少道题？!</blockquote>
                    <form class="layui-form" style="max-width: 700px;margin: 40px auto;">
                        <div class="layui-form-item">
                            <label class="layui-form-label">免费次数:</label>
                            <div class="layui-input-block">
                                <input type="text" name="hits" placeholder="免费查看次数" class="layui-input"
                                    lay-verType="tips" lay-verify="required" value="{$info}" required />
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-filter="formSubmitBas" lay-submit>&emsp;提交&emsp;</button>
                                <button type="reset" class="layui-btn layui-btn-primary">&emsp;重置&emsp;</button>
                            </div>
                        </div>
                    </form>
    
                </div>
            </div>
        </div>

    <!-- js部分 -->
    <script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
    <script type="text/javascript" src="/static/assets/js/common.js?v=312"></script>
    <script>
        layui.use(['layer', 'form', 'laydate'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var form = layui.form;

            // 监听表单提交
            form.on('submit(formSubmitBas)', function (data) {
                $.ajax({
                    type: "POST",                      //请求类型
                    url: "{:url('admin/main/money')}",//URL
                    data: data.field,   //传递的参数
                    dataType: "json",                 //返回的数据类型
                    success: function (data) {
                        if (data.code == 0) {
                            layer.alert(data.msg);
                        } else {
                            layer.alert(data.msg);
                        }
                    },
                    error: function (data) {
                        alert("请求失败");
                    }
                });

                return false;
            });
        });
    </script>
</body>

</html>